package com.xnyzc.lhy.finance.service.fegin.cp;

import com.alibaba.fastjson.JSONObject;
import com.xnyzc.lhy.finance.service.fegin.cp.fallback.TradeServiceFallback;
import com.xnyzc.lhy.resource.common.cp.dto.SingleQueryParam;
import com.xnyzc.lhy.resource.common.cp.dto.SingleTradeResult;
import com.xnyzc.lhy.resource.common.cp.dto.TransactionInfo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "${feign.applicationName.resource}", fallback = TradeServiceFallback.class)
public interface IFinanceTradeService {

    /**
     * 单笔代付
     * @param transactionInfo 交易信息
     */
    @ApiOperation(value = "单笔代付", notes = "单笔代付")
    @PostMapping(value = "cp/singleTrade")
    JSONObject singleTrade(@ApiParam(name = "transactionInfo", value = "单笔代付交易信息") @RequestBody TransactionInfo transactionInfo);

    /**
     * 单笔代付查询
     * @param singleQueryParam 代付查询信息
     * @return
     */
    @ApiOperation(value = "单笔代付查询", notes = "单笔代付查询")
    @PostMapping(value = "cp/singleQuery")
    SingleTradeResult singleQuery(@ApiParam(name = "singleQueryParam", value = "单笔代付查询信息") @RequestBody SingleQueryParam singleQueryParam);
}
